<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>

<style>
    * {
        padding: 0;
        margin: 0;
    }
    
    .zp {
        margin: 0 auto;
        margin-top: 30px;
        background-image: url("zp.jpg");
        background-repeat: no-repeat;
        background-size: contain;
        width: 500px;
        height: 500px;
        position: relative;
    }
    
    .zp img {
        position: absolute;
        font-size: 25px;
        top: 50%;
        margin-top: -175px;
        left: 50%;
        margin-left: -120px;
        cursor: pointer;
        transition: transform 2s;
    }
</style>

<body>
    <div class="zp">
        <img class="zz" src="zz.png">
    </div>
    <script>
        var zz = document.querySelector(".zz");
        var zp = document.querySelector(".zp");
        zz.style.transform = "rotate(0deg)";
        zz.style.transformOrigin = "50% 73%";

        zz.addEventListener("click", function(e) {
            var randoms = (Math.random() * 2400) + 720;
            zz.style.transform = "rotate(" + randoms + "deg)";
        })
    </script>
</body>

</html>